package com.gzz.demo.pattern.observer;

public class BinaryObserver implements IObserver {
    private Subject subject;
    public BinaryObserver(Subject subject){
        this.subject = subject;
        this.subject.attach(this);
    }

    public void update() {
        System.out.println( "Binary String: "
                + Integer.toBinaryString( subject.getState() ) );
    }
}
